Problem with #include in a DB

I have a problem.
I'm making a small DB so the user can choose between 3 different scripts from it.
The problem is that by putting #include inside the  function of one of these buttons, this #include executes immediately, without even having the to click in option inside the dialog box.

Can someone give me a tip about what I'm doing wrong?

void AEROchoice(DBE calledFrom) {

#include <my_dxl_path>

}

void SRSchoice(DBE escolhaScript) {

#include <my_dxl_path>

}



DB escolhaScript = create("  \0/\0/\0/ ", styleCentered | styleFixed)
DBE AERO, SRS, SIR


label (escolhaScript, "Choose the script you want to run." "\n")

AERO = button(escolhaScript, "AERO", AEROchoice)

SRS = button(escolhaScript, "SRS", SRSchoice)
SRS -> "left" -> "flush" -> AERO
SRS -> "top" -> "aligned" -> AERO

SIR = button(escolhaScript, "SIR", SIRchoice)
SIR -> "left" -> "flush" -> SRS
SIR -> "top" -> "aligned" -> SRS


realize escolhaScript
setCenteredSize(escolhaScript, 250, 150)
show escolhaScript

I did this as a query, which worked very well, but the option screen disappears as soon as I choose one option (which is expected), but I wanted to keep this option screen active, so I chose to create a DB.


braolive - Thu Mar 01 16:20:10 EST 2018

Re: Problem with #include in a DB
Mathias Mamsch - Fri Mar 02 03:01:20 EST 2018

#include is a "preprocessor" statement, i.e. it will be processed when the DOORS client is parsing your file, before the first line of DXL executes. #include means "Whatever is inside the include file put it at the place of the include", so its like an "insert the file here". This means it depends on how your include file looks. If the include file contains the source code of the function then you are probably fine and the problem should be elsewhere. 

Regards, Mathias